package cn.kgc.tangcco.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

/**
 * @author 李昊哲
 * @Description
 * @create 2021/1/9 10:27
 */
@Controller
public class PageController {

    @RequestMapping(value = "/error/{status}")
    public String errorPage(@PathVariable Integer status, @RequestHeader(value = "user-agent", required = false) String ua) {
        switch (status) {
            case 400:
            case 404:
                return "/html/404.html";
            case 500:return "/html/500.html";
            default:
                return "/html/defaul.html";
        }
    }
}
